/* 
 * File:   object.h
 * Author: bjorn
 *
 * Created on September 2, 2007, 6:44 PM
 */

#ifndef _OBJECT_H
#define	_OBJECT_H

#define eruta_struct(name) struct name##_struct
#define eruta_struct_typedef(name) typedef struct name##_struct name##_type
#define eruta_struct_object(name)  typedef name##_type * name
    
    
#define eruta_object(name) eruta_struct(name);\
                           eruta_struct_typedef(name);\
                           eruta_struct_object(name) 

						   
typedef void * (*object_copy_function) (void * self);
typedef void * (*object_free_function) (void * self);
typedef long   (*object_hash_function) (void * self);  
typedef int    (*object_comp_function) (void * self, void * other);  
						   
struct Objectinfo_struct {
	object_free_function free;
	object_copy_function copy;
	object_hash_function hash;
	object_comp_function compare;
};

typedef struct Objectinfo_struct * Objectinfo;
						   
/*
 #define (self, function  
 function(self, ( arguments )) 
 
 met(self, param, param, param, ...)
 self->met(self,  param, param, param, ...);
 scall(self, met, param, param, param, ...);
 self_do(met, param, param, param, ...) 
 
 
*/ 


#endif	/* _OBJECT_H */

